package com.wjy.icu.common;

import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * @Description: 缓存接口
 * @author: wangjunyong
 * @date: 2019/4/24 14:28
 */
@Component
public interface CacheManage {
    //新增
    <T> void set(String key, T value);
    //新增+时间(毫秒)
    <T> void set(String key, T value, Long timeSpan);
    //获取
    <T> T get(String key);
    //移除
    void remove(String key);
    //判断是否存在
    boolean isExist(String key);
    //延时
    void expire(String key, Long timeSpan);

    <T> void addSet(String key, T value);

    Set<?> getList(String key);
    <T> void removeSet(String key, T value);
    <T> void removeAll();
}
